package com.lxy.cxcyxmmsbackend.sys.controller;


import com.lxy.cxcyxmmsbackend.sys.entity.QxglDz;
import com.lxy.cxcyxmmsbackend.sys.res.Result;
import com.lxy.cxcyxmmsbackend.sys.service.QxglDzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 动作管理
 * @author 刘新颖
 * @since 2024-01-11
 */
@Api(tags = "权限管理_菜单")
@RestController
@RequestMapping("/qxglDz")
public class QxglDzController {

    @Resource
    QxglDzService qxglDzService;

    @ApiOperation("查询菜单下的动作权限")
    @RequestMapping("selectQxglDzByCdBh/{cdBh}")
    public Result selectQxglDzByCdBh(@PathVariable("cdBh") @ApiParam("菜单编号") String cdBh) {
        return qxglDzService.selectQxglDzByCdBh(cdBh);
    }

    @ApiOperation("新增动作")
    @RequestMapping("insertQxglDz")
    public Result insertQxglDz(@RequestBody QxglDz qxglDz) {
        return qxglDzService.insertQxglDz(qxglDz);
    }

    @ApiOperation("修改动作")
    @RequestMapping("updateQxglDz")
    public Result updateQxglDz(@RequestBody QxglDz qxglDz) {
        return qxglDzService.updateQxglDz(qxglDz);
    }

    @ApiOperation("删除动作")
    @RequestMapping("deleteQxglDz/{dzBh}")
    public Result deleteQxglDz(@PathVariable("dzBh") String dzBh) {
        return qxglDzService.deleteQxglDz(dzBh);
    }

}

